<template>
	<view class="navBar">
		<uni-nav-bar :backgroundColor="backgroundColor" :lineHeight="lineHeight" :paddingTop="paddingTop" :title="title"
			:height="height + 'px'" :color="returnIcon" :leftIcon="type == 'back' ? 'back' : 'closeempty'" :border="false"
			@clickLeft="back">
		</uni-nav-bar>
	</view>
</template>

<script>
	const app = getApp()
	export default {
		props: {
			title: {
				type: String,
				default: ''
			},
			height: {
				type: String,
				default: app.globalData.navBarHeight
			},
			lineHeight: {
				type: String,
				default: app.globalData.lineHeight
			},
			paddingTop: {
				type: String,
				default: app.globalData.paddingTop
			},
			backgroundColor: {
				type: String,
				default: 'transparent'
			},
			type: {
				type: String,
				default: 'back'
			},
			returnIcon: {
				type: String,
				default: '#000'
			}
		},
		methods: {
			back() {
				uni.navigateBack()
			}
		}
	}
</script>

<style lang="scss">
	.navBar {
		width: 100%;
		font-size: 36rpx;
		position: fixed;
		top: 0;
		left: 0;
		z-index: 9999;

		::v-deep .uni-nav-bar-text {
			font-size: 30rpx !important;
		}
	}
</style>